package com.training.java.corejava.collections;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;


public class LaptopListDemo {

	public static void main(String[] args) 
	{
		Laptop laptop1= new Laptop("Hp","pavillion","intel core");
		Laptop laptop2= new Laptop("Dell","inspiron","Quad core");
		Laptop laptop3= new Laptop("Acer","aspire","Dual core");
		

		laptop1.setOs("windows");
		laptop2.setOs("Linux");
		laptop3.setOs("Mac");
		
		
		List laptopList = new ArrayList();
		laptopList.add(laptop1);
		laptopList.add(laptop2);
		laptopList.add(laptop3);
		
		Iterator ite = laptopList.iterator();
		while(ite.hasNext())
		{
			Laptop laptop = (Laptop)ite.next();
			System.out.println("company: "+ laptop.getCompany() );
			System.out.println("model: "+ laptop.getModel() );
			System.out.println("processor: "+ laptop.getProcessor() );
			System.out.println("OS: "+ laptop.getOs() );
			System.out.println("*************************" );
			
			
		}
		
		

	}

}
